﻿@model VacationsRequest.Models.VacationApproval
@{
    ViewBag.Title = "Approval Details";
}
<h2>
    @ViewBag.EmployeeName</h2>
<fieldset>
    <legend>Vacation Approval</legend>
    <div style="display: table; width: 100%">
        <div style="display: table-row">
            <div style="display: table-cell">
                <div class="display-label">
                    Approver</div>
                <div class="display-field">
                    @ViewBag.ApproverName
                </div>
            </div>
            <div style="display: table-cell">
                <div class="display-label">
                    Date Created</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.DateCreated)
                </div>
            </div>
            <div style="display: table-cell">
                <div class="display-label">
                    From Date</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.FromDate)
                </div>
            </div>
        </div>
        <div style="display: table-row">
            <div style="display: table-cell">
                <div class="display-label">
                    To Date</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.ToDate)
                </div>
            </div>
            <div style="display: table-cell">
                <div class="display-label">
                    Status</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.Status.Description)
                </div>
            </div>
            <div style="display: table-cell">
                <div class="display-label">
                    Number of Days Reserved</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.NumDays)
                </div>
            </div>
        </div>

        <div style="display: table-row">
            <div style="display: table-cell">
                <div class="display-label">
                    Comment</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.Comment)
                </div>
            </div>
            <div style="display: table-cell">
                <div class="display-label">
                    Approver Comment</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.ApproverComment)
                </div>
            </div>
            <div style="display: table-cell">
                <div class="display-label">Approval Date</div>
                <div class="display-field">
                    @Html.DisplayFor(model => model.ApprovalDate)
                </div>
            </div>
        </div>
    </div>
</fieldset>
<table style="width: 350px;">
    <tr>
        <th>
            Date
        </th>
        <th>
            Comment
        </th>
    </tr>
    @foreach (VacationsRequest.Models.VacationDay item in ViewBag.VacationsList)
    {
        <tr @Html.UsedDateStyle(item.Date)>
            <td style="text-align: right; padding-right: 5px;">
                @item.Date.ToShortDateString()
            </td>
            <td>
                @item.Comment
            </td>
        </tr>
    }
</table>
<p>
    @if (User.IsInRole("Administrator"))
    {
        @Html.ActionLink("Back to List", "Index", "ApprovalStatus")
    }
    else
    {
        @Html.ActionLink("Back to Vacation Scheduler", "EmployeeDetails", "VacationDays", new { id = Model.IdEmployee }, "")
    }
</p>
